import { defineStore } from 'pinia'
import { ref } from 'vue'
export const MapTile = {
  WALL: 1,
  FLOOR: 2,
}
export const useMapStore = defineStore('map', () => {
  const map = ref([])

  function setupMap(mapData) {
    map.value = mapData
  }
  function isWall(position) {
    return map.value[position.y][position.x] === MapTile.WALL
  }
  return {
    map,
    setupMap,
    isWall,
  }
})
